package shejimoshi.zuhemoshi;

public class client {
    public static void main(String[] args) {
        Composite root = new Composite();
        root.add(new Leaf());
        root.add(new Leaf());
        root.add(new Composite());
        Composite subComposite = (Composite) root.children.get(2);
        subComposite.add(new Leaf());

        // 客户端可以一致地使用所有对象
        root.operation();
    }
}
